package com.tm.fiverole.handler;

import com.tm.fiverole.result.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author wangSang
 * @create 2022-08-21 14:09
 */
@RestControllerAdvice
@Slf4j
public class GlobalException {


        @ExceptionHandler
        public Result exception(Exception exception){
            exception.printStackTrace();
            log.error("全局异常");
            return Result.ERROR();
        }



}
